home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Games / Stella Obscura 1.1 / source / Parts ƒ / LogoWindo.p < prev    next >
Encoding:
Text File  |  1990-05-13  |  1.5 KB  |  73 lines  |  [TEXT/PJMM]

  1. unit LogoWindo;
  2.  
  3. interface
  4.  
  5.     procedure Init_LogoWindo;
  6.     procedure Close_LogoWindo;
  7.     procedure UpDate_LogoWindo;
  8.     procedure Open_LogoWindo;
  9.  
  10. implementation
  11.  
  12.     var
  13.         logoWindo: WindowPtr;
  14.         tempRect: Rect;
  15.         Pic_Handle: PicHandle;
  16.  
  17. {=================================}
  18.  
  19.     procedure Init_LogoWindo;
  20.     begin
  21.         logoWindo := nil;
  22.     end;
  23.  
  24. {=================================}
  25.  
  26.     procedure Close_LogoWindo;
  27.     begin
  28.         DisposeWindow(logoWindo);
  29.         logoWindo := nil;
  30.     end;
  31.  
  32. {=================================}
  33.  
  34.     procedure UpDate_LogoWindo;
  35.         var
  36.             SavePort: WindowPtr;
  37.     begin
  38.         if (logoWindo <> nil) then
  39.             begin
  40.                 GetPort(SavePort);
  41.                 SetPort(logoWindo);
  42.                 Pic_Handle := GetPicture(1999);
  43.                 SetRect(tempRect, 0, 0, 321, 308);
  44.                 if (Pic_Handle <> nil) then
  45.                     begin
  46.                         ClipRect(tempRect);
  47.                         HLock(Handle(Pic_Handle));
  48.                         tempRect.Right := tempRect.Left + (Pic_Handle^^.picFrame.Right - Pic_Handle^^.picFrame.Left);
  49.                         tempRect.Bottom := tempRect.Top + (Pic_Handle^^.picFrame.Bottom - Pic_Handle^^.picFrame.Top);
  50.                         HUnLock(Handle(Pic_Handle));
  51.                     end;
  52.                 if (Pic_Handle <> nil) then
  53.                     DrawPicture(Pic_Handle, tempRect);
  54.                 SetRect(tempRect, 0, 0, 1023, 1023);
  55.                 ClipRect(tempRect);
  56.                 ReleaseResource(Handle(Pic_Handle));
  57.                 SetPort(SavePort);
  58.             end;
  59.     end;
  60.  
  61. {=================================}
  62.  
  63.     procedure Open_LogoWindo;
  64.     begin
  65.         logoWindo := GetNewWindow(1999, nil, Pointer(-1));
  66.         SelectWindow(logoWindo);
  67.         SetPort(logoWindo);
  68.         UpDate_LogoWindo;
  69.     end;
  70.  
  71. {=================================}
  72.  
  73. end.                                    {End of unit}